Skip to content

test(s3): keep XML test stream blocking#212

Merged
overtrue merged 1 commit into
mainfrom
codex/fix-windows-xml-test
May 23, 2026
Merged

test(s3): keep XML test stream blocking#212
overtrue merged 1 commit into
mainfrom
codex/fix-windows-xml-test

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Related issue

No issue. Fixes a recent CI regression on windows-latest.

Evidence / reproduction

The CI run for fix(ci): align protected file checks (#208) failed in Test (windows-latest) while running cargo test --workspace. The failing test was client::tests::custom_headers_are_added_to_xml_requests_before_signing, where the local XML test server hit a request-read failure and the client reported a send failure.

Root cause

The XML test helper sets the listener to nonblocking while waiting for a request. On Windows, the accepted TcpStream can still behave as nonblocking, so the immediate request read can fail with WouldBlock.

Fix

After accepting the request stream, explicitly switch it back to blocking mode before applying the read timeout and parsing the request.

Validation

  • cargo test -p rc-s3 custom_headers_are_added_to_xml_requests_before_signing --lib
  • cargo test -p rc-s3 --lib
  • cargo fmt --all --check
  • cargo clippy -p rc-s3 --all-targets -- -D warnings
  • git diff --check
  • make pre-commit

Copilot AI review requested due to automatic review settings May 23, 2026 00:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a Windows CI regression in the S3 client XML test helper by ensuring accepted TCP connections are put back into blocking mode before applying timeouts and reading the HTTP request. This aligns the test server behavior across platforms and prevents WouldBlock read failures on windows-latest.

Changes:

  • After TcpListener::accept, explicitly set the accepted TcpStream to blocking mode (set_nonblocking(false)).
  • Keep the existing read timeout and request parsing logic unchanged, but now reliably reachable on Windows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overtrue overtrue merged commit dfe90f8 into main May 23, 2026
19 checks passed
@overtrue overtrue deleted the codex/fix-windows-xml-test branch May 23, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants